package com.yangjie.autotest.hpsa.domain;

import java.util.Date;
import java.util.Set;

import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.MappedSuperclass;

import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

@MappedSuperclass
public abstract class BaseOrder {
	@Id
	private Integer psid = 0;
	

	@ManyToOne(optional = true, fetch = FetchType.EAGER)
	@JoinColumn(name = "FileID", insertable = false,updatable = false, nullable=true)
	@NotFound(action = NotFoundAction.IGNORE)
	private ProvisionFile provisionFile = null;
	

	
	protected Integer OriPsId = 0;
	protected Integer SuspendPsId = 0;
	protected Integer BusiCode = 0;
	protected Integer DoneCode = 0;
	protected Integer OrderType = 0;
	protected Integer PrioLevel = 0;
	protected Integer DeadLine = 0;
	protected Integer PsServiceType = 0;
	protected String Msisdn = null;
	protected String NewMsisdn = null;
	protected String Imsi = null;
	protected String NewImsi = null;
	protected Integer AccountId = 0;
	protected Integer SubId = 0;
	protected String SubPasswd = null;
	protected Integer PlanId = 0;
	protected Integer RollbackFlag = 0;
	protected Integer SubType = 0;
	protected Integer ActionId = 0;
	protected Integer PsStatus = 0;
	protected Integer FailTimes = 0;
	protected Integer OrgId = 0;
	protected Integer FailCode = 0;
	protected Integer StopType = 0;
	protected Integer AsyncFlag = 0;
	protected Integer ActFlag = 0;
	protected Integer HandId = 0;
	protected Integer HandOPId = 0;
	protected Integer RetOpId = 0;
	protected Integer ServiceId = 0;
	protected Integer FileID = null;

	protected String NetworkType = null;
	protected String TargetParam = null;
	protected String FailReason = null;
	protected String OpId = null;
	protected String RegionCode = null;
	protected String PsNetCode = null;
	protected String PsDeviceCode = null;
	protected String HandNotes = null;
	protected String RetNotes = null;
	protected String Notes = null;
	protected String FailLog = null;
	protected String FeedBackCode = null;
	protected String Token = null;

	protected Date SubValidDate = null;
	protected Date CreateDate = null;
	protected Date StartDate = null;
	protected Date EndDate = null;
	protected Date RetDate = null;
	protected Date StatusDate = null;
	protected Date BookDate = null;
	protected Date HandDate = null;

	public abstract Set<BaseSubOrder> getSubOrders() ;
	
//	public abstract ProvisionFile getProvisionFile() ;
	
	
	public Integer getOriPsId() {
		return OriPsId;
	}

	public ProvisionFile getProvisionFile() {
		return provisionFile;
	}

	public void setProvisionFile(ProvisionFile provisionFile) {
		this.provisionFile = provisionFile;
	}

	public void setOriPsId(Integer oriPsId) {
		OriPsId = oriPsId;
	}

	public Integer getSuspendPsId() {
		return SuspendPsId;
	}

	public void setSuspendPsId(Integer suspendPsId) {
		SuspendPsId = suspendPsId;
	}

	public Integer getBusiCode() {
		return BusiCode;
	}

	public void setBusiCode(Integer busiCode) {
		BusiCode = busiCode;
	}

	public Integer getDoneCode() {
		return DoneCode;
	}

	public void setDoneCode(Integer doneCode) {
		DoneCode = doneCode;
	}

	public Integer getOrderType() {
		return OrderType;
	}

	public void setOrderType(Integer orderType) {
		OrderType = orderType;
	}

	public Integer getPrioLevel() {
		return PrioLevel;
	}

	public void setPrioLevel(Integer prioLevel) {
		PrioLevel = prioLevel;
	}

	public Integer getDeadLine() {
		return DeadLine;
	}

	public void setDeadLine(Integer deadLine) {
		DeadLine = deadLine;
	}

	public Integer getPsServiceType() {
		return PsServiceType;
	}

	public void setPsServiceType(Integer psServiceType) {
		PsServiceType = psServiceType;
	}

	public String getMsisdn() {
		return Msisdn;
	}

	public void setMsisdn(String msisdn) {
		Msisdn = msisdn;
	}

	public String getNewMsisdn() {
		return NewMsisdn;
	}

	public void setNewMsisdn(String newMsisdn) {
		NewMsisdn = newMsisdn;
	}

	public String getImsi() {
		return Imsi;
	}

	public void setImsi(String imsi) {
		Imsi = imsi;
	}

	public String getNewImsi() {
		return NewImsi;
	}

	public void setNewImsi(String newImsi) {
		NewImsi = newImsi;
	}

	public Integer getAccountId() {
		return AccountId;
	}

	public void setAccountId(Integer accountId) {
		AccountId = accountId;
	}

	public Integer getSubId() {
		return SubId;
	}

	public void setSubId(Integer subId) {
		SubId = subId;
	}

	public String getSubPasswd() {
		return SubPasswd;
	}

	public void setSubPasswd(String subPasswd) {
		SubPasswd = subPasswd;
	}

	public Integer getPlanId() {
		return PlanId;
	}

	public void setPlanId(Integer planId) {
		PlanId = planId;
	}

	public Integer getRollbackFlag() {
		return RollbackFlag;
	}

	public void setRollbackFlag(Integer rollbackFlag) {
		RollbackFlag = rollbackFlag;
	}

	public Integer getSubType() {
		return SubType;
	}

	public void setSubType(Integer subType) {
		SubType = subType;
	}

	public Integer getActionId() {
		return ActionId;
	}

	public void setActionId(Integer actionId) {
		ActionId = actionId;
	}

	public Integer getPsStatus() {
		return PsStatus;
	}

	public void setPsStatus(Integer psStatus) {
		PsStatus = psStatus;
	}

	public Integer getFailTimes() {
		return FailTimes;
	}

	public void setFailTimes(Integer failTimes) {
		FailTimes = failTimes;
	}

	public Integer getOrgId() {
		return OrgId;
	}

	public void setOrgId(Integer orgId) {
		OrgId = orgId;
	}

	public Integer getFailCode() {
		return FailCode;
	}

	public void setFailCode(Integer failCode) {
		FailCode = failCode;
	}

	public Integer getStopType() {
		return StopType;
	}

	public void setStopType(Integer stopType) {
		StopType = stopType;
	}

	public Integer getAsyncFlag() {
		return AsyncFlag;
	}

	public void setAsyncFlag(Integer asyncFlag) {
		AsyncFlag = asyncFlag;
	}

	public Integer getActFlag() {
		return ActFlag;
	}

	public void setActFlag(Integer actFlag) {
		ActFlag = actFlag;
	}

	public Integer getHandId() {
		return HandId;
	}

	public void setHandId(Integer handId) {
		HandId = handId;
	}

	public Integer getHandOPId() {
		return HandOPId;
	}

	public void setHandOPId(Integer handOPId) {
		HandOPId = handOPId;
	}

	public Integer getRetOpId() {
		return RetOpId;
	}

	public void setRetOpId(Integer retOpId) {
		RetOpId = retOpId;
	}

	public Integer getServiceId() {
		return ServiceId;
	}

	public void setServiceId(Integer serviceId) {
		ServiceId = serviceId;
	}

	public Integer getFileID() {
		return FileID;
	}

	public void setFileID(Integer fileID) {
		FileID = fileID;
	}

	public String getNetworkType() {
		return NetworkType;
	}

	public void setNetworkType(String networkType) {
		NetworkType = networkType;
	}

	public String getTargetParam() {
		return TargetParam;
	}

	public void setTargetParam(String targetParam) {
		TargetParam = targetParam;
	}

	public String getFailReason() {
		return FailReason;
	}

	public void setFailReason(String failReason) {
		FailReason = failReason;
	}

	public String getOpId() {
		return OpId;
	}

	public void setOpId(String opId) {
		OpId = opId;
	}

	public String getRegionCode() {
		return RegionCode;
	}

	public void setRegionCode(String regionCode) {
		RegionCode = regionCode;
	}

	public String getPsNetCode() {
		return PsNetCode;
	}

	public void setPsNetCode(String psNetCode) {
		PsNetCode = psNetCode;
	}

	public String getPsDeviceCode() {
		return PsDeviceCode;
	}

	public void setPsDeviceCode(String psDeviceCode) {
		PsDeviceCode = psDeviceCode;
	}

	public String getHandNotes() {
		return HandNotes;
	}

	public void setHandNotes(String handNotes) {
		HandNotes = handNotes;
	}

	public String getRetNotes() {
		return RetNotes;
	}

	public void setRetNotes(String retNotes) {
		RetNotes = retNotes;
	}

	public String getNotes() {
		return Notes;
	}

	public void setNotes(String notes) {
		Notes = notes;
	}

	public String getFailLog() {
		return FailLog;
	}

	public void setFailLog(String failLog) {
		FailLog = failLog;
	}

	public String getFeedBackCode() {
		return FeedBackCode;
	}

	public void setFeedBackCode(String feedBackCode) {
		FeedBackCode = feedBackCode;
	}

	public String getToken() {
		return Token;
	}

	public void setToken(String token) {
		Token = token;
	}

	public Date getSubValidDate() {
		return SubValidDate;
	}

	public void setSubValidDate(Date subValidDate) {
		SubValidDate = subValidDate;
	}

	public Date getCreateDate() {
		return CreateDate;
	}

	public void setCreateDate(Date createDate) {
		CreateDate = createDate;
	}

	public Date getStartDate() {
		return StartDate;
	}

	public void setStartDate(Date startDate) {
		StartDate = startDate;
	}

	public Date getEndDate() {
		return EndDate;
	}

	public void setEndDate(Date endDate) {
		EndDate = endDate;
	}

	public Date getRetDate() {
		return RetDate;
	}

	public void setRetDate(Date retDate) {
		RetDate = retDate;
	}

	public Date getStatusDate() {
		return StatusDate;
	}

	public void setStatusDate(Date statusDate) {
		StatusDate = statusDate;
	}

	public Date getBookDate() {
		return BookDate;
	}

	public void setBookDate(Date bookDate) {
		BookDate = bookDate;
	}

	public Date getHandDate() {
		return HandDate;
	}

	public void setHandDate(Date handDate) {
		HandDate = handDate;
	}

	public String toString() {
		StringBuffer sb = new StringBuffer();
		sb.append("ORDER_ID=").append(this.psid).append(",");
		sb.append("ACTIONID=").append(this.ActionId).append(",");
		sb.append("STATUS=").append(PsStatus).append(",");
		sb.append("MSISDN=").append(this.Msisdn).append(",");
		sb.append("newMsisdn=").append(NewMsisdn).append(",");
		sb.append("IMSI=").append(this.Imsi).append(",");
		sb.append("newIMSI=").append(NewImsi).append(",");
		 if(provisionFile != null) {
		 sb.append("filename=").append(provisionFile.getFILENAME());
		 } else {
		 sb.append("filename=").append("null");
		 }

		return sb.toString();
	}

}
